<template>
	<view class="remind">
		<view class="container">
			<view class="info">
				<view class="info_left">
					每天定时提醒
				</view>
				<view class="info_right">
					<u-switch
						space="6" 
						v-model="userInfo.timedReminder" 
						activeColor="#f9ae3d" 
						inactiveColor="rgb(230, 230, 230)"
						size="40"
						@change="timeReminderChange">
					</u-switch>
				</view>
			</view>
			<view class="info"> 
				<view class="info_left">
					数据异常提醒
				</view>
				<view class="info_right">
					<u-switch
						space="6" 
						v-model="userInfo.dataExceptionReminder" 
						activeColor="#f9ae3d" 
						inactiveColor="rgb(230, 230, 230)"
						size="40"
						@change="dataExceptionReminderChange">
					</u-switch>
				</view>
			</view>
		</view>
	
		<!-- 弹出框 时间选择-->
		<!-- <u-datetime-picker
					ref="datetimePicker"
					:show="isShowTime"
		      v-model="value1"
					mode="time"
					:formatter="formatter"
		      ></u-datetime-picker> -->
	
		<!-- 弹出框 提醒信息-->
		<!-- <u-popup 
			:show="isShowMsg" 
			mode="bottom" 
			:round="50"
			@close="isShowMsg = false" 
			@open="open"
			class="popup_msg"
			>
			<view class="pop_msg_container">
				<view class="pop_msg_title">您的</view>
				<view class="pop_msg_main">
					<view class="pop_msg_info">1.指脉氧饱和（SpO2）已经低于90%；</view>
					<view class="pop_msg_info">2.您的最大心率已经高（207-0.7x年龄）x（60%-70%）</view>
				</view>
				<view class="pop_msg_bottom">请您及时联系医护人员或者通过运动反馈进行咨询</view>
			</view>
		</u-popup> -->
	</view>
</template>

<script>
	import funUtils from '@/utils/fun.js'
	export default {
		data() {
			return {
				userInfo: {
					timedReminder: null,
					dataExceptionReminder: null
				},
				
				isShowMsg: false,
				isShowTime: false,
				value1: Number(new Date())
			}
		},
		onLoad() {
			const info = uni.getStorageSync("userInfo");
			
			this.userInfo.timedReminder = Boolean(info.timedReminder);
			this.userInfo.dataExceptionReminder = Boolean(info.dataExceptionReminder);
		},
		methods: {
			timeReminderChange(val) {		
				funUtils.setUserInfoSuccss('timedReminder', val);
			},
			dataExceptionReminderChange(val) {
				funUtils.setUserInfoSuccss('dataExceptionReminder', val);
			}
		}
	}
</script>

<style lang="scss" scoped> 
.remind {
	width: 100%;
	height: 100vh;
	background-color: #eee;
	overflow: hidden;
	.container {
		overflow: hidden;
		.info {		
			margin: 30rpx 20rpx ;
			height: 120rpx;
			background-color: #fff;
			border-radius: 32rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 0 40rpx;
			
		}
	}
	
	
		
}
</style>
